<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['prefix'=>'admin','namespace'=>'admin'],function(){
    Route::group(['middleware'=>'admin.logined'],function(){
        Route::match(['get','post'],'/','Index@login');
        Route::match(['get','post'],'register','Index@register');
        Route::match(['get','post'],'forget','Index@forget');
        Route::match(['post'],'reset','Index@reset');
    });
    
    Route::group(['middleware'=>'admin.login'],function(){
        Route::match(['get'],'index','Home@index');
        Route::match(['post'],'loginout','Home@loginout');
        Route::match(['get'],'adminlist','Admin@all');
        Route::match(['get','post'],'adminadd','Admin@add');
        Route::match(['get','post'],'admindel','Admin@del');
        Route::match(['post','get'],'adminstatus','Admin@status');
        Route::match(['get','post'],'adminedit/{id?}','Admin@edit');

        Route::match(['get'],'memberlist','Member@all');
        Route::match(['get','post'],'memberadd','Member@add');
        Route::match(['get','post'],'memberedit/{id?}','Member@edit');
        Route::match(['post'],'memberdel','Member@del');

        Route::match(['get'],'catelist','Cate@all');
        Route::match(['get','post'],'cateadd','Cate@add');
        Route::match(['post'],'catedel','Cate@del');
        Route::match(['get','post'],'catedit/{id?}','Cate@edit');
        Route::match(['post'],'catesort','Cate@sort');

        Route::match(['get','post'],'system','System@system');

        Route::match(['get'],'articlelist','Article@alls');
        Route::match(['get','post'],'articleadd','Article@add');
        Route::match(['get','post'],'articledit','Article@edit');
        Route::match(['post','get'],'articledel','Article@del');
        Route::match(['post'],'articlestus','Article@stus');
        Route::match(['post'],'articleistop','Article@istop');
    });
    
});
